import { InputQuestion, QuestionBase, RadioQuestion, SelectQuestion, UploadQuestion } from '@/components/public-template/DynamicForm/dynamic-form-base';
import { TextTable, TableBase } from '@/components/public-template/DynamicTable/table-base';

class IndexService {
  getQuestions = () => {
    let questions: QuestionBase<any>[] = [
      new InputQuestion({
        key: 'assignee',
        label: '转交给',
        value: undefined,
        required: true,
        prompt: '请选择',
        type: 'slot',
        state: {
          slotName: 'selectPerson'
        },

        order: 1
      }),
      new InputQuestion({
        key: 'comment',
        label: '意见',
        value: undefined,
        type: 'textarea',
        order: 1
      }),
      // new RadioQuestion({
      //   key: 'key',
      //   label: '审批意见通过邮件发送给申请人',
      //   value: 0,
      //   options: [
      //     {
      //       label: '是',
      //       value: 1
      //     },
      //     {
      //       label: '否',
      //       value: 0
      //     }
      //   ],
      //   order: 1
      // }),
      new UploadQuestion({
        label: '图片',
        key: 'imgList',
        state: {
          multiple: true, //开启多个上传
          gird: 12,
          accept: '.jpeg,.png,.jpg',
          isImage: true,
          maxCount: 9
        }
      }),
      new UploadQuestion({
        label: '附件',
        key: 'fileList',
        state: {
          multiple: true, //开启多个上传
          gird: 12,
          listType: 'text',
          maxCount: 9,
          fieldNames: {
            fileId: 'id',
            name: 'name',
            size: 'size',
            suffix: 'suffix',
          }
        }
      })
    ];
    return questions.sort((a, b) => a.order - b.order);
  };
}

export default new IndexService();
